package leetcode.D300.T283;

/**
 * @File Info: leetcode -- <Solution>
 * @Author: 18362
 * @Create: 2022-02-17 16:46:26 星期四
 */

class Solution {
    public void moveZeroes(int[] nums) {
        int i=0, j=0;
        while(j < nums.length) {
            while (j < nums.length && nums[j] == 0) {
                ++j;
            }
            if (j < nums.length) {
                nums[i++] = nums[j++];
            }
        }
        while(i < nums.length) {
            nums[i++] = 0;
        }
    }
}
